import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 获取设备通道直播链接(具有保活功能，建议按需模式25s-30s调用一次)/videoApi/ChannelStream

export function getChannelUrl(query) {
    return request({
      url: '/videoApi/ChannelStream?deviceId=' + query.deviceId + '&channel=' +  query.channel 
      + '&protocol=FLV&monitorServerId=' + query.monitorServerId,
      method: 'get',
    })
  }

  //获取巡查问题列表 /monitors/CONTENT/list
  export function ContentList(data,query) {
    return request({
      url: '/monitors/CONTENT/list',
      method: 'post',
      params: query,
      data: data,
      isEncrypt: false
    })
  }
  
  // //新增巡查问题 /monitors/CONTENT/list
  // export function ContentAdd(data) {
  //   return request({
  //     url: '/monitors/CONTENT/add',
  //     method: 'post',
  //     data: data,
  //     isEncrypt: false
  //   })
  // }

  // 按日查询通道录像（云端/设备  /videoApi/queryDaily
  export function queryDaily(query) {
    return request({
      url: '/videoApi/queryDaily?monitorServerId=' + query.monitorServerId + '&channelId=' +  query.channelId 
      + '&recordType=' + 'Device' + '&period=' + query.period + '&start=' + query.start + '&limit=' +  query.limit,
      method: 'get',
    })
  }
  // 获取设备录像回看流地址/videoApi/playback
  export function videoplayback(query) {
    return request({
      url: '/videoApi/playback?monitorServerId=' + query.monitorServerId + '&channelId=' +  query.channelId 
      + '&file=' + query.file + '&sTime=' + query.sTime + '&eTime=' +  query.eTime + '&protocol=FLV',
      method: 'get',
    })
  }